import dva from 'dva';
import { browserHistory } from 'dva/router';

import createLoading from 'dva-loading';
import { message } from 'antd';

import './index.html';
import './index.css';


const ERROR_MSG_DURATION = 3; // 3 秒

// 1. Initialize
const app = dva({
	history: browserHistory,// http://localhost:8000/#/users ---》配置后会变成 http://localhost:8000/users  ，去除#访问
  	onError(e) {
  		message.error(e.message, ERROR_MSG_DURATION);
  	}
});

// 2. Plugins
// app.use({});
app.use(createLoading());
// 3. Model
// app.model(require('./models/example'));

// 4. Router
app.router(require('./router'));

// 5. Start
app.start('#root');
